// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import Axios from "axios";
import qs from "qs";
import Vuex from "vuex";
import store from './store';
import { Carousel,CarouselItem,Row,Col,Dialog,Button,dialog,Message,Input,MessageBox,Upload,Progress, Cascader} from 'element-ui';


Vue.use(Carousel);
Vue.use(CarouselItem);
Vue.use(Row);
Vue.use(Col);
Vue.use(Vuex);
Vue.use(Dialog);
Vue.use(Input);
Vue.use(Button);
Vue.use(Upload);
Vue.use(Progress);
Vue.use(Cascader);
Vue.prototype.$message = Message;
Vue.prototype.$confirm = MessageBox.confirm;

Vue.prototype.HOST = '/api';//指定URL前半部分
Vue.config.productionTip = false;
Vue.prototype.$axios = Axios;

//post请求设置数据
Axios.interceptors.request.use(function (config) {
		if (config.method === "post") {
			config.data = qs.stringify(config.data);
		}
    return config;
  }, function (error) {
    return Promise.reject(error);
  });

new Vue({
  el: '#app',
  router,
  store,
  template: '<App/>',
  components: { App }
})
